const express = require("express");
 
const router = express.Router();
 
//get
router.get("/add-product", (req, res, next) => {
  console.log("get")
  res.send(
    `<form action="/product/add-product" method="POST">
     <input type="text" name="title">
     <button type="submit">Create Product</button>
     </form>`
  );
});
//post
router.post("/add-product", (req, res, next) => {
  console.log("post")
  console.log(req.body);
  res.redirect("/");
});
module.exports = router;